float4x4 World;
float4x4 View;
float4x4 Projection;

Texture texOrigin;
Texture texDestiny;
float t;

// TODO: add effect parameters here.


sampler textureOriginSampler = sampler_state
{
	texture = <texOrigin>;
	magfilter = LINEAR;
	minfilter = LINEAR;
	mipfilter = LINEAR;
	AddressU = clamp;
	AddressV = clamp;
};
sampler textureDestinySampler = sampler_state
{
	texture = <texDestiny>;
	magfilter = LINEAR;
	minfilter = LINEAR;
	mipfilter = LINEAR;
	AddressU = clamp;
	AddressV = clamp;
};

struct VertexShaderInput
{
    float4 Position : POSITION0;
	float2 Texture : TEXCOORD0;
    // TODO: add input channels such as texture
    // coordinates and vertex colors here.
};

struct VertexShaderOutput
{
    float4 Position : POSITION0;	
	float2 Texture : TEXCOORD0;
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    VertexShaderOutput output;

    float4 worldPosition = mul(input.Position, World);
    float4 viewPosition = mul(worldPosition, View);
    output.Position = mul(viewPosition, Projection);
	output.Texture = input.Texture;


    return output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
	//float4 origin = tex2D(textureOriginSampler, input.Texture);
	//float4 destiny = tex2D(textureDestinySampler, input.Texture);

	//float4 output = origin * (1-t) + destiny *t;
	//return output;

	float4 origin = tex2D(textureOriginSampler, input.Texture);
    clip(origin.a - 0.5 * 1);

	return origin;
}

technique Technique1
{
    pass Pass1
    {
	    VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}
